import React, { Component } from "react";
import { bindActionCreators } from "redux";
import { connect } from "react-redux";
import PreviewList from "../../components/preview/index";
import { listAction } from "./homeRedux";

class Home extends Component {
  render() {
    const { list, listAction } = this.props;
    return (
      <div>
        <h1>Home</h1>
        <PreviewList {...list} {...listAction} />
      </div>
    );
  }
}

export default connect(
  state => {
    return {
      list: state.home.list
    };
  },
  dispatch => {
    return {
      listAction: bindActionCreators(listActions, dispatch)
    };
  }
)(Home);
